package com.ruoyi.net.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.uuid.IdUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.net.mapper.ElementSrSrtpProtectoamMapper;
import com.ruoyi.net.domain.ElementSrSrtpProtectoam;
import com.ruoyi.net.service.IElementSrSrtpProtectoamService;

/**
 * 网元-SR-srtp-保护oamService业务层处理
 * 
 * @author net
 * @date 2024-11-17
 */
@Service
public class ElementSrSrtpProtectoamServiceImpl implements IElementSrSrtpProtectoamService 
{
    @Autowired
    private ElementSrSrtpProtectoamMapper elementSrSrtpProtectoamMapper;

    /**
     * 查询网元-SR-srtp-保护oam
     * 
     * @param id 网元-SR-srtp-保护oam主键
     * @return 网元-SR-srtp-保护oam
     */
    @Override
    public ElementSrSrtpProtectoam selectElementSrSrtpProtectoamById(String id)
    {
        return elementSrSrtpProtectoamMapper.selectElementSrSrtpProtectoamById(id);
    }

    /**
     * 查询网元-SR-srtp-保护oam列表
     * 
     * @param elementSrSrtpProtectoam 网元-SR-srtp-保护oam
     * @return 网元-SR-srtp-保护oam
     */
    @Override
    public List<ElementSrSrtpProtectoam> selectElementSrSrtpProtectoamList(ElementSrSrtpProtectoam elementSrSrtpProtectoam)
    {
        return elementSrSrtpProtectoamMapper.selectElementSrSrtpProtectoamList(elementSrSrtpProtectoam);
    }

    /**
     * 新增网元-SR-srtp-保护oam
     * 
     * @param elementSrSrtpProtectoam 网元-SR-srtp-保护oam
     * @return 结果
     */
    @Override
    public int insertElementSrSrtpProtectoam(ElementSrSrtpProtectoam elementSrSrtpProtectoam)
    {
        String uuid = IdUtils.simpleUUID();
        if (StringUtils.isEmpty(elementSrSrtpProtectoam.getId())) {
            elementSrSrtpProtectoam.setId(uuid);
        }
        elementSrSrtpProtectoam.setCreateBy(SecurityUtils.getUsername());
        elementSrSrtpProtectoam.setCreateTime(DateUtils.getNowDate());
        elementSrSrtpProtectoam.setUpdateBy(SecurityUtils.getUsername());
        elementSrSrtpProtectoam.setUpdateTime(DateUtils.getNowDate());
        return elementSrSrtpProtectoamMapper.insertElementSrSrtpProtectoam(elementSrSrtpProtectoam);
    }

    /**
     * 修改网元-SR-srtp-保护oam
     * 
     * @param elementSrSrtpProtectoam 网元-SR-srtp-保护oam
     * @return 结果
     */
    @Override
    public int updateElementSrSrtpProtectoam(ElementSrSrtpProtectoam elementSrSrtpProtectoam)
    {
        elementSrSrtpProtectoam.setUpdateBy(SecurityUtils.getUsername());
        elementSrSrtpProtectoam.setUpdateTime(DateUtils.getNowDate());
        return elementSrSrtpProtectoamMapper.updateElementSrSrtpProtectoam(elementSrSrtpProtectoam);
    }

    /**
     * 批量删除网元-SR-srtp-保护oam
     * 
     * @param ids 需要删除的网元-SR-srtp-保护oam主键
     * @return 结果
     */
    @Override
    public int deleteElementSrSrtpProtectoamByIds(String[] ids)
    {
        return elementSrSrtpProtectoamMapper.deleteElementSrSrtpProtectoamByIds(ids);
    }

    /**
     * 删除网元-SR-srtp-保护oam信息
     * 
     * @param id 网元-SR-srtp-保护oam主键
     * @return 结果
     */
    @Override
    public int deleteElementSrSrtpProtectoamById(String id)
    {
        return elementSrSrtpProtectoamMapper.deleteElementSrSrtpProtectoamById(id);
    }
}
